﻿@page "/TcpServiceManage"

@attribute [TabItemOption(Text = "TcpServiceManage")]
<PageTitle>TcpServiceManage</PageTitle>

<Table @ref="@m_table" TItem="TcpServiceModel" IsPagination="true" PageItemsSource="@PageItemsSource"
       IsStriped="true" IsBordered="true" ShowEditButton="false" ShowDeleteButton="false"
       ShowSkeleton="true" IsMultipleSelect="true" ShowAdvancedSearch="false"
       ShowToolbar="true" DataService="TcpServiceManager" SelectedRowsChanged="@SelectedRowsChanged" ShowSearch="true" EditMode="EditMode.Popup">
    <TableToolbarTemplate>
        <TableToolbarButton IsEnableWhenSelectedOneRow="true" TItem="TcpServiceModel" Color="Color.Primary" Text="编辑" OnClickCallback="@OnEditClickCallback" />
        <TableToolbarButton IsEnableWhenSelectedOneRow="true" TItem="TcpServiceModel" Color="Color.Danger" Text="停止" OnClickCallback="@OnStopClickCallback" />
    </TableToolbarTemplate>
    <TableColumns>
        <TableColumn @bind-Field="@context.Name" Searchable="true" />
        <TableColumn @bind-Field="@context.IpHosts" />
        <TableColumn @bind-Field="@context.ServerState" Editable="false" />
    </TableColumns>
</Table>